<!DOCTYPE html>
<html>

<head>
    <meta name="renderer" content="webkit">
    <!-- <meta content="IE=Edge" http-equiv="X-UA-Compatible"> -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>公共卫生网络信息监测系统</title>
    <link rel="stylesheet" type="text/css" href="../css/base.css">
    <link rel="stylesheet" type="text/css" href="../css/manage-log.css">
    <script src="../js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="../js/commen.js" type="text/javascript"></script>
    <script src="../js/manage-log.js" type="text/javascript"></script>
    <script src="../js/jquery.datetimepicker.full.js"></script>
    <link href="../css/sy.css" rel="stylesheet" type="text/css"/>
    <script src="../js/vue.min.js"></script>
    <script src="../js/axios.min.js"></script>
    <script src="../js/component.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/jquery.datetimepicker.css"/>
</head>

<body id="top">
<div id="app">
    <head-template></head-template>
    <div class="main">
        <div class="cw1200 clearfix">
            <system-menu-template active-menu="3"></system-menu-template>
            <div class="rightside fr w980">
                <div>
                    <div class="hide" style="display: block;">
                        <div class="kr-item clearfix">
                            <p>时间：</p>
                            <div class="date-box"><input id="datetimepicker" type="text" class="Wdate">
                            </div>
                            <span>到</span>
                            <div class="date-box"><input id="datetimepicker2" type="text" class="Wdate">
                            </div>
                            <a class="statis-sec-btn fl" @click="searchData()">检 索</a>
                        </div>
                        <div class="user-list">
                            <table>
                                <thead>
                                <tr>
                                    <th width="42">序号</th>
                                    <th>操作</th>
                                    <th>操作者</th>
                                    <th>操作时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr v-for="(item,index) in operateLogList">
                                    <td>{{index}}</td>
                                    <td>{{operateType[item.operateType]}}</td>
                                    <td>{{item.username}}</td>
                                    <td>{{item.operateTime}}</td>
                                </tr>
                                </tbody>
                            </table>
                            <page-template v-bind:total-count="totalCount" v-bind:query-data="queryData"
                                           v-bind:page-count="pageCount"></page-template>
                        </div>
                    </div>
                </div>
            </div>
            <!--rightside end-->
        </div>
    </div>
    <div class="main footer">
        <p>地址：北京市西城区白广路***********</p>
        <p>电话：010-83******</p>
        <p>版权所有：**省疾病预防控制中心&emsp;&emsp;网站备案：*ICP备********号</p>
    </div>
</div>
<script src="../js/placeholder.js" type="text/javascript"></script>
</body>
<script type="text/javascript">

    $(function () {
        $(".user_name").append(localStorage.getItem("username"))
    })

    let app = new Vue({
        el: "#app",
        data: {
            queryData: {
                pageNum: 1,
                pageSize: 10,
                startTime: null,
                endTime: null,
                operateType: null
            },
            totalCount: 0,
            pageCount: 0,
            operateType: ['登录','浏览','检索'],
            operateLogList: []
        },
        methods: {
            initData() {
                axios.post("/logs", this.queryData).then(function (res) {
                    let result = res.data.data;
                    if (res.data.code == 200) {
                        app.operateLogList = result.list;
                        app.totalCount = result.total;
                        app.pageCount = result.pages;
                    }
                })
            },
            searchData() {
                this.queryData.startTime = $("#datetimepicker").val();
                this.queryData.endTime = $("#datetimepicker2").val();
                this.initData();
            }
        },
        mounted: function () {
            this.$nextTick(() => {
                this.initData();
            });
        }
    })

    $('#datetimepicker').datetimepicker({
        lang: "ch", //语言选择中文 注：旧版本 新版方法：$.datetimepicker.setLocale('ch');
        format: "Y-m-d",      //格式化日期
        timepicker: false
    });
    $('#datetimepicker2').datetimepicker({
        lang: "ch", //语言选择中文 注：旧版本 新版方法：$.datetimepicker.setLocale('ch');
        format: "Y-m-d",      //格式化日期
        timepicker: false
    });
</script>
</html>